import Vue from "vue";
import Router from "vue-router";

Vue.use(Router);

let RouteList = [
    {
        path: "/",
        component: resolve => require(["@/views/layout/App.vue"], resolve),
        meta: {
            title: "推广管理",
            keepAlive: false
        },
        children: [
            {
                path: "/",
                name: "promotion",
                meta: {
                    title: "推广管理",
                    keepAlive: false
                },
                component: resolve => require(["@/views/ad/promotion/index.vue"], resolve)
            },
            {
                path: "/ad_report",
                name: "ad_report",
                meta: {
                    title: "数据报表",
                    keepAlive: false
                },
                component: resolve => require(["@/views/ad/report/index.vue"], resolve)
            },
            {
                path: "/ad_account",
                name: "ad_account",
                meta: {
                    title: "账号管理",
                    keepAlive: false
                },
                component: resolve => require(["@/views/ad/account/index.vue"], resolve)
            },
            {
                path: "/ad_finance",
                name: "ad_finance",
                meta: {
                    title: "财务流水",
                    keepAlive: false
                },
                component: resolve => require(["@/views/ad/finance/index.vue"], resolve)
            },
            {
                path: "/ad_personal_info",
                name: "ad_personal_info",
                meta: {
                    title: "个人详情",
                    keepAlive: false
                },
                component: resolve => require(["@/views/ad/personalInfo/index.vue"], resolve)
            },
            {
                path: "/ad_system",
                name: "ad_system",
                meta: {
                    title: "系统管理",
                    keepAlive: false
                },
                component: resolve => require(["@/views/ad/system/index.vue"], resolve)
            },
            {
                path: "/ad_test1",
                name: "ad_test1",
                meta: {
                    title: "test1",
                    keepAlive: false
                },
                component: resolve => require(["@/views/ad/test1/index.vue"], resolve)
            },
            {
                path: "/ad_test2",
                name: "ad_test2",
                meta: {
                    title: "test2",
                    keepAlive: false
                },
                component: resolve => require(["@/views/ad/test2/index.vue"], resolve)
            }
        ]
    },
    {
        path: "/login",
        name: "Login",
        meta: {
            title: "后台登录",
            keepAlive: false
        },
        components: {
            blank: resolve => require(["@/views/login/Login.vue"], resolve)
        }
    },
    {
        path: "/registry",
        name: "Registry",
        meta: {
            title: "后台注册",
            keepAlive: false
        },
        components: {
            blank: resolve => require(["@/views/login/Registry.vue"], resolve)
        }
    },
    {
        path: "/forgetPw",
        name: "ForgetPw",
        meta: {
            title: "忘记密码",
            keepAlive: false
        },
        components: {
            blank: resolve => require(["@/views/login/ForgetPw.vue"], resolve)
        }
    }
];

export default new Router({ routes: RouteList });
